package com.it2.service2.controller;

import com.it2.service1.api.ConsumerService;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
public class HelloController {

    //注入service
//    @org.apache.dubbo.config.annotation.Reference  //(已不推荐)生成代理对象
    @org.apache.dubbo.config.annotation.DubboReference //生成代理对象
    private ConsumerService consumerService;

    @GetMapping("/hello")
    public String hello() {
        System.out.println("==========hello============");
        return "hello,"+consumerService.service();//dubbo远程调用
    }

}
